<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改角色信息</title>
    <link href="${request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="${request.contextPath}/static/fonts/font-awesome.css" rel="stylesheet">
    <link href="${request.contextPath}/static/css/animate.css" rel="stylesheet" type="text/css">
    <link href="${request.contextPath}/static/css/jdGrid/ui.jqgrid.css" rel="stylesheet" type="text/css"/>
    <link href="${request.contextPath}/static/css/style.css" rel="stylesheet">
    <script type="text/javascript">
        var ctx = "";
        var __cityId = "";
    </script>
</head>
<body class="gray-bg">
<div class="wrapper">
    <div class="row">
        <div class="ibox">
            <div class="ibox-content">
                <form  class="form-horizontal" id="defaultForm"  action="/roleManage/add"  method="post" onsubmit="return false;">
                    <input name="roleId" class="form-control" type="hidden" value="${role.roleId?c}"/>
                    <div class="form-group"><label class="col-sm-2 control-label"><font color="red">*</font>角色名称</label>
                        <div class="col-sm-10">
                            <input id="roleName" name="roleName" class="form-control required" type="text" value="${role.roleName}" maxlength="50"/>
                        </div>
                    </div>
                    <div class="form-group"><label class="col-sm-2 control-label"><font color="red">*</font>角色值</label>
                        <div class="col-sm-10">
                            <input id="roleKey" name="roleKey" class="form-control required" type="text" value="${role.roleKey}" maxlength="50"/>
                            <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group"><label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-10">
                            <textarea id="remark" name="remark" maxlength="200" class="form-control " rows="3">${role.remark}</textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>${request.contextPath}
<script src="${request.contextPath}/static/js/jquery.min.js"></script>
<script src="${request.contextPath}/static/js/bootstrap.min.js"></script>
<script src="${request.contextPath}/static/js/layer/layer.min.js"></script>
<script src="${request.contextPath}/static/js/tookeen.js"></script>
<script src="${request.contextPath}/static/js/common.js"></script>
<script src="${request.contextPath}/static/js/contabs-v2.js" type="text/javascript"></script>
<script src="${request.contextPath}/static/js/validate/jquery.validate.min.js"></script>
<script src="${request.contextPath}/static/js/validate/messages_zh.min.js"></script>
<script src="${request.contextPath}/static/jquery.form.min.js" type="text/javascript"></script>
<script type="text/javascript">
    var validateForm;
    var  doSubmit = function(){
        if(validateForm.form()) {
            var index = parent.layer.getFrameIndex(window.name);
            $("#defaultForm").ajaxSubmit(function (result) {
                if (result.code  ==0) {
                    var callback = share.remove(index);
                    if (callback && typeof(callback) === "function") {
                        callback();
                    }
                    parent.layer.msg('操作成功', {icon: 1});
                    parent.layer.close(index);
                } else if (result.code == 500) {
                    parent.layer.alert(result.message, {
                        icon: 2
                    })
                } else {
                    parent.layer.close(index);
                }
            });

        }
        return false;
    };
    $(document).ready(function() {
        $("#name").focus();
        validateForm = $("#defaultForm").validate({
            submitHandler: function(form){
                doSubmit();
            },
            errorPlacement: function(error, element) {
                if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                    error.appendTo(element.parent().parent().parent());
                } else {
                    error.insertAfter(element);
                }
            }
        });
    });
</script>
</html>